Skip to content

feat: add --secrets-file to cf previews deploy - #537

Merged
edmundhung merged 1 commit into
mainfrom
edmundhung/previews-deploy-secrets-file
Nov 19, 2026
Merged

edmundhung merged 1 commit into
mainfrom
edmundhung/previews-deploy-secrets-file

Conversation

@edmundhung

@edmundhung edmundhung commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Add --secrets-file to cf previews deploy. It accepts the same JSON or .env file format as cf deploy --secrets-file. Right now cf has no way to give a Preview its secrets: they have to be set in the dashboard or with wrangler preview secret put.

The flag is passed to previewBuildOutput(). That function parses the file the same way cf deploy does and uploads each entry as a secret on the Preview deployment. The help text reuses the cf deploy description, reworded for a Preview deployment. Typed metadata, the generated command catalogs, tests, and a minor changeset are included.

Dependencies

Requires @cloudflare/deploy-helpers 0.28.0, which adds secretsFile to the previewBuildOutput() arguments (cloudflare/workers-sdk#16751). #708 brings it to main, so this PR doesn't change any dependencies.

@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@537

commit: 71773aa

@ask-bonk

ask-bonk Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 276.2 ms 13.1 ms 267.7 ms 326.4 ms
base 270.9 ms 3.6 ms 265.3 ms 277.3 ms

Δ (PR vs base): ↑ +5.4 ms (+2.0%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

@edmundhung
edmundhung force-pushed the edmundhung/previews-deploy-secrets-file branch from 220999d to 71773aa Compare November 19, 2026 15:40
@ask-bonk

ask-bonk Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@edmundhung
edmundhung marked this pull request as ready for review November 19, 2026 15:52
@edmundhung
edmundhung requested a review from a team as a code owner November 19, 2026 15:52
@edmundhung
edmundhung enabled auto-merge November 19, 2026 15:52

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — No issues found. The flag is wired through to previewBuildOutput, the metadata and tests match it, and the deploy-helpers 0.28.0 dependency is already in place.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The new option is wired correctly into the builder and the previewBuildOutput() call. The description refactor gives cf deploy the same text as before.


📝 Documentation: ✅ LGTM

The help text, the metadata and the changeset match the new behaviour.


Reviewed commit: 71773aa6

@edmundhung
edmundhung added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 29442c5 Nov 19, 2026
12 checks passed
@edmundhung
edmundhung deleted the edmundhung/previews-deploy-secrets-file branch November 19, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants